package com.example.insurance_service.service.img;


import com.example.insurance_service.dao.UserDao;
import com.example.insurance_service.domain.User;
import com.example.insurance_service.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class UserServiceImg implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }

    @Override
    public User findById(Integer insureId) {
        final List<User> list = userDao.findAllById(Collections.singleton(insureId));
        return list.get(0);
    }
}
